<%--
  Created by IntelliJ IDEA.
  User: LENOVO
  Date: 2021/9/28
  Time: 11:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String n1 = request.getParameter("first");
    String n2 = request.getParameter("second");
    double num1 = Double.parseDouble(n1);
    double num2 = Double.parseDouble(n2);
    String f = request.getParameter("fun");
//    out.println(f);
    double end = 0;
    if (f.equals("1")) {
        end = num1 + num2;
    } else if (f.equals("2")) {
        end = num1 - num2;

    } else if (f.equals("3")) {
        end = num1 * num2;

    } else if (f.equals("4")) {
        end = num1 / num2;
    }
    out.println(end);
%>
</body>
</html>
